<!-- 按钮：用于打开模态框 -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
  打开模态框
</button>

<!-- 模态框 -->
<div class="modal fade" id="myModal">
  <div class="modal-dialog">
    <div class="modal-content">

      <!-- 模态框头部 -->
      <div class="modal-header">
        <h4 class="modal-title">选择图片</h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>

      <!-- 模态框主体 -->
      <div class="modal-body">
        <div *ngFor="let image of images">
          <div *ngIf="image==selectedImg" class="img-selected-div">
            <img class="fab-img" [src]="getImgUrl(image)" (click)="selectImage(image)"/><br/>
            <label>{{image.name}}</label>
          </div>
          <div *ngIf="image!=selectedImg" class="img-div">
            <img class="fab-img" [src]="getImgUrl(image)" (click)="selectImage(image)"/><br/>
            <label>{{image.name}}</label>
          </div>
        </div>
      </div>
      <!-- 模态框底部 -->
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" data-dismiss="modal" (click)="confirmImage()">提交更改</button>
      </div>
    </div>
  </div>
</div>
